/**
 * @Author: likang xie
 * @Date: 2019-11-09 10:40:52
 * @Usage: 常用工具类
 */

// ---- 边框相关 ----
.border {
  border: 2upx solid $color-border;

  &.border-bottom {
    border: none;
    border-bottom: 2upx solid $color-border;
  }

  &.border-top {
    border: none;
    border-top: 2upx solid $color-border;
  }

  &.border-bold {
    border-width: 10upx;
  }

  &.border-deep {
    border-color: $color-border-deep;
  }
}

.radius {
  border-radius: 8upx;
}

.circle {
  border-radius: 50%;
  overflow: hidden;
}

.shadow {
  box-shadow: 0 0 20upx 6upx rgba($color: #999, $alpha: 0.1);
}

// ---- 文字相关 ----
.bold {
  font-weight: bolder;
}

.underline {
  text-decoration: underline;
}

.delete {
  text-decoration: line-through;
}

.lh-2 {
  line-height: 2;
}

// 文字溢出
@for $i from 1 through 4 {
  .hide-text-#{$i} {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: $i;
    overflow: hidden;
  }
}

@for $i from 10 through 40 {
  .fz-#{$i} {
    font-size: $i * 2 * 1upx !important;
  }
}

// ---- 交互反馈 ----
.pointer {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;

  &:active {
    background-color: $color-active;
    filter: brightness(1);
  }

  &.pointer-filter {
    &:active {
      filter: brightness(0.8);
    }
  }
}

// ---- 边距相关 ----
@for $i from 1 through 10 {
  .mt-#{$i * 5} {
    margin-top: $i * 5 * 2upx;
  }

  .mr-#{$i * 5} {
    margin-right: $i * 5 * 2upx;
  }

  .mb-#{$i * 5} {
    margin-bottom: $i * 5 * 2upx;
  }

  .ml-#{$i * 5} {
    margin-left: $i * 5 * 2upx;
  }

  .m-#{$i * 5} {
    margin: $i * 5 * 2upx;
  }

  .pt-#{$i * 5} {
    padding-top: $i * 5 * 2upx;
  }

  .pr-#{$i * 5} {
    padding-right: $i * 5 * 2upx;
  }

  .pb-#{$i * 5} {
    padding-bottom: $i * 5 * 2upx;
  }

  .pl-#{$i * 5} {
    padding-left: $i * 5 * 2upx;
  }

  .p-#{$i * 5} {
    padding: $i * 5 * 2upx;
  }
}
